package com.gree.sso.service;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.gree.sso.entity.Admin;

import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;

public interface SSOService {

    /**
     * 登录认证方法返回票据ticket
     * @param admin
     * @return
     */
    String login(Admin admin) throws NoSuchAlgorithmException, JsonProcessingException;

    /**
     * 验证票据ticket返回用户信息
     * @param ticket
     * @return
     */
    Admin validate(String ticket) throws UnsupportedEncodingException;

    /**
     * 用户退出
     * @param ticket
     * @return
     */
    void logout(String ticket);
}
